import time
import tools
import os,sys
BASE_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0,BASE_PATH)

from auto_replace import Replace_settings
from restart_tomcat import Mytomcat
from test_setting import HOST_APP,HOST_USER,HOST_PASSWD,MODEL_PATH

tools.logger.info('更新环境为【%s】,取模板文件的位置为【%s】'%(HOST_APP,MODEL_PATH))
replace_setting = Replace_settings()
replace_setting.auto_replace()
time.sleep(3)
myTomcat = Mytomcat(HOST_APP, 22, HOST_USER, HOST_PASSWD)#测试服务
myTomcat.auto_run()